<template>
  <div>
    <div
      class="singer"
      v-for="item in songs"
      :key="item.id"
      @click="toMusicIndex(item.artists[0].id)"
    >
      <div class="img">
        <img src="../../static/img/sge.jpg" alt="" />
      </div>
      <div class="text">
        <p class="van-ellipsis">{{ item.artists[0].name }}</p>
        <p class="van-ellipsis">
          专辑：<em>{{ item.album.name }}</em> 单曲：<em>{{ item.album.size }}首</em> 
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "MusicSearchSinger",
  props: ["songs"],

  data() {
    return {};
  },

  mounted() {},

  methods: {
    toMusicIndex(id) {
      this.$router.push({
        path: "/MusicIndex",
        query: { id },
      });
    },
  },
};
</script>

<style lang="less" scoped>
.singer {
  display: flex;
  height: 3.125rem;
  margin: 0.625rem;
  .img {
    width: 3.125rem;
    height: 3.125rem;
    line-height: 3.125rem;
    text-align: center;
    background-color: purple;
    img {
      width: 100%;
      height: 100%;
      border-radius: 0.3125rem;
    }
  }
  .text {
    flex: 1;
    max-width: 15.625rem;
    padding-left: 0.9375rem;
    text-align: left;
    p {
      line-height: 1.5625rem;
    }
    p:nth-child(1) {
      font-size: 1rem;
     color:#4fc08d;
    }
    p:nth-child(2) {
      font-size: 0.75rem;
     color:grey;
    }
  }
}
</style>